from typing import Optional
from pydantic import BaseModel

class MealOrderBase(BaseModel):
    work_area_id: int = -1
    package_order_id: int = -1
    package_order_title: Optional[str] = None
    meal_type: str
    number_of_people: int
    meal_count: int
    price_per_person: float
    total_amount: float
    currency: str = "HKD"
    restaurant_name: str
    restaurant_address: Optional[str] = None
    menu_details: Optional[str] = None
    notes: Optional[str] = None

class MealOrderCreate(MealOrderBase):
    pass

class MealOrderUpdate(BaseModel):
    package_order_id: Optional[int] = None
    package_order_title: Optional[str] = None
    meal_type: Optional[str] = None
    number_of_people: Optional[int] = None
    meal_count: Optional[int] = None
    price_per_person: Optional[float] = None
    total_amount: Optional[float] = None
    currency: Optional[str] = None
    restaurant_name: Optional[str] = None
    restaurant_address: Optional[str] = None
    menu_details: Optional[str] = None
    notes: Optional[str] = None

class MealOrder(MealOrderBase):
    ID: int

    class Config:
        from_attributes = True 